#include <stdio.h>

#define M 5
/*
* I_3.c
*
*  Created on: April, 19, 2009
*      Author: yimingliu@fudan.edu.cn
*/

int funI_3_fun(int n, int xx[M][M])
{
	int i,j,sum=0;
	for(i=0;i<n;i++)
	{
		for(j=0;j<n;j++)
		{
			printf("%d ",xx[i][j]);
		}
		sum+=xx[i][i]+xx[n-i-1][n-i-1];
		printf("\n");
	}
	return sum;
}

void funI_3()
{
	int aa[M][M]={{1,2,3,4,5},{4,3,2,1,0},{6,7,8,9,0},{9,8,7,6,5},{3,4,5,6,7}};
	printf("\nThe sum of all elements on 2 diagnals is %d,",funI_3_fun(M,aa));
}